/**
 * 产品查看js
 */
var productInfoLook={
	dataCache:null,
		
	startEvent:function(){
		$("#recordTab ul").idTabs();
		productInfoLook.showInfoById();
	},
	
	showInfoById:function(){
		var lokId=art.dialog.data('lokId');  //查看id
		var url = 'mgr/ProductInfoCtrl/getProductInfoById';
		var params ={
				'id':lokId
		};
		var cb = function(data){
			if(data.resultCode==200){
				var ret=data.result;
				for(var i in ret){
					var text=ret[i];
					if(i=='establishDate'||i=='onlineDate'||i=='endDate'||i=='releasesDate'||i=='balanceDate'||i=='discountDate'){
						text=text==null?'':(new Date(text)).format('yyyy-MM-dd');
					}else if(i=='prodType'||i=='proTerm'||i=='publishType'||i=='riskLevel'||i=='currency'){
						text=jsUtils.getDictionaryTxtByType(i, text);
					}else if(i=='isOversea'||i=='discount'||i=='discountRate'){
						text=(text==null?'':(text==0?'否':'是'));
					}else if(i=='clearDate'){
                        text=text==null?'':(new Date(text)).format('yyyy-MM-dd hh:mm:ss');
					}
					$('#com-addForm td[name="'+i+'"]').html(text);
				}
				$('#introduceTxt').html((ret.introduceTxt==null?'':ret.introduceTxt));
				$('#incomeTxt').html((ret.incomeTxt==null?'':ret.incomeTxt));
				$('#riskctrlTxt').html((ret.riskctrlTxt==null?'':ret.riskctrlTxt));
			}
		};
		sendApiNoLoad(url, params, cb, 'POST');
	},
	
	init:function(){
		productInfoLook.startEvent();
	}
}
$(document).ready(function() {
	productInfoLook.init();
});